BitmovinCastManager

open class BitmovinCastManager

Singleton providing access to GoogleCast related features. The BitmovinCastManager needs to be initialized in the Application, if casting should be used.

Note: Make sure to call updateContext on every Activitys switch.

Properties

applicationId
Link copied to clipboard
private open val applicationId: String
instance
Link copied to clipboard
private open val instance: BitmovinCastManager
messageNamespace
Link copied to clipboard
private open val messageNamespace: String

Functions

addMessageReceivedCallback
Link copied to clipboard
open fun addMessageReceivedCallback(callback: Cast.MessageReceivedCallback)
Adds a MessageReceivedCallback to the BitmovinCastManager.
disconnect
Link copied to clipboard
open fun disconnect()
Disconnects from the current cast session.
getCastControllerActivityClass
Link copied to clipboard
open fun getCastControllerActivityClass(): Class
Returns the class of the expanded controller activity, used at initialization.
initialize
Link copied to clipboard
open fun initialize()
Initializes the BitmovinCastManager.
open fun initialize(castControllerActivity: Class)
Initializes the BitmovinCastManager.
open fun initialize(applicationId: String, messageNamespace: String)
Initializes the BitmovinCastManager.
open fun initialize(@Nullable() applicationId: String, messageNamespace: String, castControllerActivity: Class)
Initializes the BitmovinCastManager.
isCastAvailable
Link copied to clipboard
open fun isCastAvailable(): Boolean
Returns true if there are cast devices nearby and available for casting.
isConnected
Link copied to clipboard
open fun isConnected(): Boolean
Returns true if currently connected to a cast session.
isConnecting
Link copied to clipboard
open fun isConnecting(): Boolean
Returns true if currently connecting to a cast session.
isInitialized
Link copied to clipboard
open fun isInitialized(): Boolean
True if the BitmovinCastManager is initialized.
removeMessageReceivedCallback
Link copied to clipboard
open fun removeMessageReceivedCallback(callback: Cast.MessageReceivedCallback)
Removes a MessageReceivedCallback from the BitmovinCastManager.
sendMessage
Link copied to clipboard
open fun sendMessage(message: String): Boolean
Sends the given message to the cast receiver.
open fun sendMessage(message: String, @Nullable() messageNamespace: String): Boolean
Sends the given message to the cast receiver on the provided messageNamespace.
sendMetadata
Link copied to clipboard
open fun sendMetadata(@NonNull() metadata: Map<String, out Any>): Boolean
Sends the given metadata wrapped in a metadata message objectto the cast receiver on the configured message namespace.The provided metadata must be json serializable.Note: Must be called from the main thread!
showDialog
Link copied to clipboard
open fun showDialog(): Boolean
Opens the cast dialog, for selecting and starting a cast session.
updateContext
Link copied to clipboard
open fun updateContext(context: Context)
Must be called in every Activity to update the context.